/**
 * Copyright (c) 2014 itemis AG (http://www.itemis.eu) and others.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 * 
 * SPDX-License-Identifier: EPL-2.0
 */
package org.eclipse.xtend.core.tests.compiler;

import org.eclipse.xtend2.lib.StringConcatenation;
import org.junit.Ignore;
import org.junit.Test;

/**
 * @author Sebastian Zarnekow - Initial contribution and API
 */
@SuppressWarnings("all")
public class CompilerBug455317Test extends AbstractXtendCompilerTest {
  @Test
  public void test_01() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Outer {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I0 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I1 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C0 extends C implements I0 {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C1 extends C implements I1 {}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val x = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Collections;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Set;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Outer {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I0 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I1 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C0 extends Outer.C implements Outer.I0 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C1 extends Outer.C implements Outer.I1 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final Set<? extends Class<? extends Outer.C>> x = Collections.<Class<? extends Outer.C>>unmodifiableSet(CollectionLiterals.<Class<? extends Outer.C>>newHashSet(Outer.C0.class, Outer.C1.class));");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void test_02() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class Outer {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I0 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I1 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C0 extends C implements I0 {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C1 extends C implements I1 {}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val x = #[ C0, C1 ]");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Collections;");
    _builder_1.newLine();
    _builder_1.append("import java.util.List;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Outer {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I0 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I1 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C0 extends Outer.C implements Outer.I0 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C1 extends Outer.C implements Outer.I1 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final List<? extends Class<? extends Outer.C>> x = Collections.<Class<? extends Outer.C>>unmodifiableList(CollectionLiterals.<Class<? extends Outer.C>>newArrayList(Outer.C0.class, Outer.C1.class));");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void test_03() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Set");
    _builder.newLine();
    _builder.append("class Outer {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I0 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I1 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C implements I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C0 extends C implements I0 {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C1 extends C implements I1 {}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<? extends Class<? extends I>> w = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Collections;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Set;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Outer {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I0 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I1 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C implements Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C0 extends Outer.C implements Outer.I0 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C1 extends Outer.C implements Outer.I1 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final Set<? extends Class<? extends Outer.I>> w = Collections.<Class<? extends Outer.I>>unmodifiableSet(CollectionLiterals.<Class<? extends Outer.I>>newHashSet(Outer.C0.class, Outer.C1.class));");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  public void test_04() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Set");
    _builder.newLine();
    _builder.append("class Outer {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I0 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I1 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C implements I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C0 extends C implements I0 {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C1 extends C implements I1 {}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<Class<? extends I>> w = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Collections;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Set;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Outer {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I0 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I1 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C implements Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C0 extends Outer.C implements Outer.I0 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C1 extends Outer.C implements Outer.I1 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final Set<Class<? extends Outer.I>> w = Collections.<Class<? extends Outer.I>>unmodifiableSet(CollectionLiterals.<Class<? extends Outer.I>>newHashSet(Outer.C0.class, Outer.C1.class));");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Ignore
  public void test_05() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Set");
    _builder.newLine();
    _builder.append("class Outer {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I0 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I1 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C0 extends C implements I0 {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C1 extends C implements I1 {}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<? extends Class<? extends I>> w = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Collections;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Set;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Outer {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I0 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I1 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C0 extends Outer.C implements Outer.I0 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C1 extends Outer.C implements Outer.I1 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final Set<? extends Class<? extends Outer.I>> w = Collections.<Class<? extends Outer.C>>unmodifiableSet(CollectionLiterals.<Class<? extends Outer.C>>newHashSet(Outer.C0.class, Outer.C1.class));");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Ignore
  public void test_06() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Set");
    _builder.newLine();
    _builder.append("class Outer {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I0 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I1 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C0 extends C implements I0 {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C1 extends C implements I1 {}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<Class<? extends I>> w = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("import java.util.Collections;");
    _builder_1.newLine();
    _builder_1.append("import java.util.Set;");
    _builder_1.newLine();
    _builder_1.append("import org.eclipse.xtext.xbase.lib.CollectionLiterals;");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("@SuppressWarnings(\"all\")");
    _builder_1.newLine();
    _builder_1.append("public class Outer {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I0 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public interface I1 extends Outer.I {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C0 extends Outer.C implements Outer.I0 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("public static class C1 extends Outer.C implements Outer.I1 {");
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("}");
    _builder_1.newLine();
    _builder_1.newLine();
    _builder_1.append("  ");
    _builder_1.append("private final Set<Class<? extends Outer.I>> w = Collections.<Class<? extends Outer.I>>unmodifiableSet(CollectionLiterals.<Class<? extends Outer.I>>newHashSet(Outer.C0.class, Outer.C1.class));");
    _builder_1.newLine();
    _builder_1.append("}");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }

  @Test
  @Ignore
  public void test_000() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("import java.util.Set");
    _builder.newLine();
    _builder.append("class Outer {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I0 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("interface I1 extends I {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C0 extends C implements I0 {}");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("static class C1 extends C implements I1 {}");
    _builder.newLine();
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Class<? extends C> x1 = C0");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Class<? extends I> x2 = C0");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val x = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<? extends Class<? extends C>> y = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<Class<? extends C>> z0 = #{ C0 }");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<Class<? extends C>> z = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<? extends Class<? extends I>> w0 = #{ C0 }");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<? extends Class<? extends I>> w = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<Class<? extends I>> v0 = #{ C0 }");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val Set<Class<? extends I>> v = #{ C0, C1 }");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    StringConcatenation _builder_1 = new StringConcatenation();
    _builder_1.append("IGNORED");
    _builder_1.newLine();
    this.assertCompilesTo(_builder, _builder_1);
  }
}
